﻿using System;
using System.Collections.Generic;

namespace Eleven.GettingStarted.EfConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var dog = new AnimalType { Name = "Cat" };
            var patient = new Patient
            {
                Name = "Tom",
                BirthDate = new DateTime(2014, 4, 13),
                AnimalType = dog,
                Visits = new List<Visit>
                {
                    new Visit { Date = DateTime.Now }
                }
            };

            using (var ctx = new VetContext())
            {
                ctx.Patients.Add(patient);
                ctx.SaveChanges();
            }
        }
    }
}
